<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="crm.util.GetBaseParam"%>
<%@page import="java.util.*"%>
<%@page import="crm.control.SaleareaControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>employees_add</title>
		<link rel="stylesheet" href="../../../resources/css/reset.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="../../../resources/css/inner.css" type="text/css" media="screen" />
		<style type='text/css'>
		 a{font-size:12px; text-decoration:none; color:#70B300;}
		</style>
		<link rel="stylesheet" type="text/css" href="../../../resources/css/jquery-check.css" />
		<script type="text/javascript" src="../../../resources/js/jquery-1.2.6.js"></script>
		<script type="text/javascript" src="../../../resources/js/jquery-check.js"></script>
		<script type="text/javascript" src="../../../resources/js/WebCalendar.js"></script>
		<script type='text/javascript'>
			$(function(){
					$('#name').keyup(function(){
					if($(this).val() != null){
						$.ajax({
							cache:false,
							data:{
							name:$('#name').val()
							},
							dataType:"text",
							url:'employees_name_is_exist.jsp',
							success:function(data){
							if(data == 0){
                            	$("#name")
                            	.removeClass('j_err') 
                            	$("#tip").css('color','#76B700')
                            	.html('此姓名可以用');
x                            } else {
                            	$("#name")
                   				.addClass('j_err')
                   				$("#tip").css('color','#C6533C')
                            	.html('此姓名已存在');
                            }
							}
						})
					} else{
						return false;
					}
				});
			})
		</script>
	</head>
	
	<body>
		<%
			request.setCharacterEncoding("UTF-8");
		%>
		<form action="employees_add_do.jsp" method="post" id="">
			<table>
				<tr>
					<td>
						姓名
					</td>
					<td style='position: relative;'>
						<input id='name' type="text" name="name"/>
						<span style='position:absolute; right:16px; top:16px;' id='tip'></span>
					</td>
				</tr>
				<tr>
					<td>
						身份证号
					</td>
					<td>
						<input type="text" name="idcard"/>
					</td>
				</tr>
				<tr>
					<td>
						性别
					</td>
					<td>
						<input type="radio" name="gender" value="1" checked />
						男
						<input type="radio" name="gender" value="0" />
						女
					</td>
				</tr>
				<tr>
					<td>
						出生年月
					</td>
					<td>
						<input type="text" name="birthday" maxlength="20"
							onClick="SelectDate(this,'yyyy-MM-dd')"/>
					</td>
				</tr>
				<tr>
					<td>
						民族
					</td>
					<td>
						<select name="nation">
							<%
								HashMap nations = GetBaseParam.getAllNations();
								Iterator it = nations.entrySet().iterator();
								while (it.hasNext()) {
									Map.Entry entry = (Map.Entry) it.next();
							%>
							<option value="<%=entry.getKey()%>"<%if(entry.getValue().equals("汉族")) out.print("selected='selected'");%>><%=entry.getValue()%></option>
							<%
								}
							%>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						用户名
					</td>
					<td>
						<input type="text" name="username" jType="en_dig"/>
					</td>
				</tr>
				<tr>
					<td>
						密码
					</td>
					<td>
						<input type="text" name="password" jType="en_dig"/>
					</td>
				</tr>
				<tr>
					<td>
						生源类别
					</td>
					<td>
						<input type="radio" name="home_type" value="0" checked />
						农村
						<input type="radio" name="home_type" value="1" />
						城市
					</td>
				</tr>
				<tr>
					<td>
						政治面貌
					</td>
					<td>
						<select name="polity">
							<%
								HashMap politys = GetBaseParam.getAllPolities();
								Iterator it2 = politys.entrySet().iterator();
								while (it2.hasNext()) {
									Map.Entry entry = (Map.Entry) it2.next();
							%>
							<option value="<%=entry.getKey()%>"<%if(entry.getValue().equals("共青团员")) out.print("selected='selected'");%>><%=entry.getValue()%></option>
							<%
								}
							%>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						婚否
					</td>
					<td>
						<input type="radio" name="is_married" value="1" checked />
						已婚
						<input type="radio" name="is_married" value="0" />
						未婚
					</td>
				</tr>
				<tr>
					<td>
						子女生日
					</td>
					<td>
						<input type="text" name="baby_birth" maxlength="20"
							onClick="SelectDate(this,'yyyy-MM-dd')"/>
					</td>
				</tr>
				<tr>
					<td>
						职务
					</td>
					<td>
						<select name="position">
							<%
								HashMap positions = GetBaseParam.getAllPostions();
								Iterator it3 = positions.entrySet().iterator();
								while (it3.hasNext()) {
									Map.Entry entry = (Map.Entry) it3.next();
							%>
							<option value="<%=entry.getKey()%>"<%if(entry.getValue().equals("销售员")) out.print("selected='selected'");%>><%=entry.getValue()%></option>
							<%
								}
							%>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						入职时间
					</td>
					<td>
						<input type="text" name="start_time" maxlength="20"
							onClick="SelectDate(this,'yyyy-MM-dd')"/>
					</td>
				</tr>
				<tr>
					<td>
						所属区域
					</td>
					<td>
						<select name="area_id">
							<%
								HashMap areas = SaleareaControl.getAllSaleArea();
								Iterator it4 = areas.entrySet().iterator();
								while (it4.hasNext()) {
									Map.Entry entry = (Map.Entry) it4.next();
							%>
							<option value="<%=entry.getKey()%>"><%=entry.getValue()%></option>
							<%
								}
							%>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						学历
					</td>
					<td>
						<select name="edu_level">
							<option value="小学" selected>
								小学
							</option>
							<option value="初中">
								初中
							</option>
							<option value="高中">
								高中
							</option>
							<option value="专科">
								专科
							</option>
							<option value="本科">
								本科
							</option>
							<option value="研究生">
								研究生
							</option>
							<option value="硕士">
								硕士
							</option>
							<option value="博士">
								博士
							</option>
							<option value="博士后">
								博士后
							</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						手机号
					</td>
					<td>
						<input type="text" name="cellphone"/>
					</td>
				</tr>
				<tr>
					<td>
						固定电话
					</td>
					<td>
						<input type="text" name="phone"/>
					</td>
				</tr>
				<tr>
					<td>
						Email
					</td>
					<td>
						<input type="text" name="email"/>
					</td>
				</tr>

				<tr>
					<td>
						家庭住址
					</td>
					<td>
						<input type="text" name="family_address"/>
					</td>
				</tr>
				<tr>
					<td colspan='2' style='text-align: center;'>
						<input type="submit" class='button' value="提交" />
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>